const { expressjwt: jwt } = require("express-jwt");
let secretKey = "fanfan"; //密匙需要匹配

const jwtAuth = jwt({
  secret: secretKey,
  credentialsRequired: true, // false：不校验
  algorithms:["HS256"],
}).unless({ 
  path: ["/users/login", "/users/reg"] //不需要校验JWT的路由地址
});

module.exports = jwtAuth;